Skip to content

feat(supervisor): make run pod automountServiceAccountToken configurable - #4302

Closed
danhngo-lx wants to merge 1 commit into
triggerdotdev:mainfrom
danhngo-lx:feat/supervisor-configurable-automount-sa-token
Closed

feat(supervisor): make run pod automountServiceAccountToken configurable#4302
danhngo-lx wants to merge 1 commit into
triggerdotdev:mainfrom
danhngo-lx:feat/supervisor-configurable-automount-sa-token

Conversation

@danhngo-lx

@danhngo-lx danhngo-lx commented Jul 20, 2026

Copy link
Copy Markdown

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

  • Set env var KUBERNETES_WORKER_AUTOMOUNT_SERVICE_ACCOUNT_TOKEN to true
  • Start a task, check the value spec.automountServiceAccountToken, the value should be true

Changelog

Run (worker) pods hardcoded automountServiceAccountToken: false, so no in-cluster ServiceAccount token/CA was mounted and workload code talking to the Kubernetes API failed (e.g. @kubernetes/client-node falling back to http://localhost:8080 -> ECONNREFUSED).

Add KUBERNETES_WORKER_AUTOMOUNT_SERVICE_ACCOUNT_TOKEN (bool, default false) to control the pod spec field, plus KUBERNETES_WORKER_SERVICE_ACCOUNT_NAME to optionally run pods under a specific ServiceAccount. Both default to today's behavior, so this is non-breaking.


Screenshots

(No screenshots)

💯

@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 02d57fe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Hi @danhngo-lx, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 367ca3f0-e3d4-4a94-a2f6-53b9dd980d34

📥 Commits

Reviewing files that changed from the base of the PR and between a7c734c and 02d57fe.

📒 Files selected for processing (4)
  • .server-changes/kubernetes-worker-automount-service-account-token.md
  • apps/supervisor/src/env.ts
  • apps/supervisor/src/workloadManager/kubernetes.ts
  • docs/self-hosting/env/supervisor.mdx

Walkthrough

Adds two supervisor environment variables for Kubernetes worker pods: one controlling ServiceAccount token automounting, disabled by default, and one selecting an optional ServiceAccount name. Pod generation now applies these settings. Documentation and a server-change note describe the configuration.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant